<?php
require_once ("../db/connectdatabase.php");

function updateCardDetail($id, $isuse) {
	$con = new ConnectDB();
	
	$tbl = "carddetail";
	$fn = array('isuse' => $isuse);
	$condition = array('carddetailid' => $id);
	return $con -> update($tbl, $fn, $condition);
}

$result = false;
if(isset($_POST['act'])) {
	$act = $_POST['act'];
	
	if($act == "edit") {
		if(isset($_POST['type']) && isset($_POST['idpe'])) {
			$vis = $_POST['type'];
			$id = $_POST['idpe'];
			$result = updateCardDetail($id, $vis);
		}
	}
}

echo json_encode($result);
?>